package com.adingxiong.cft.quartz;

import lombok.extern.slf4j.Slf4j;
import org.quartz.*;

import java.util.ArrayList;

/**
 * @ClassName HelloJob
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/12/8 15:45
 **/
@Slf4j
public class HelloJob implements Job {

    public HelloJob(){

    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("Hello ! helloJob is executing");
        JobKey jobKey = context.getJobDetail().getKey();
        JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();

        String says = jobDataMap.getString("jobSays");
        float aFloat = jobDataMap.getFloat("myFloatValue");
        ArrayList state = (ArrayList)jobDataMap.get("myStateData");
        System.err.println("Instance " + jobKey + " of DumbJob says: " + says + ", and val is: " + aFloat);
    }
}
